package msu.ml.core.xml;

import msu.ml.core.*;
import msu.ml.data.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;

/**
 * @author Reginald M Mead
 * @version 1.0
 */
public class ThresholdRuleParser implements IClassificationRuleParser
{
	public ClassificationRule parse(Element element)
	{
		double threshold = Double.parseDouble(element.getAttribute("threshold"));
		int target = Integer.parseInt(element.getAttribute("target"));

      if(ApplicationSettings.getInstance().getConfig("verbose").equals("true"))
      {
         System.out.println("Threshold Rule {threshold = " + 
         threshold + "; target = " + target + "}");
      }

		return new ThresholdRule(threshold, target);
	}
}
